#include "hy_common_func.h"
#include "hy_random.h"

int random_int( int begin, int end )
{
	return hy_random::instance()->next_int( begin, end );
}

bool send_player_list_msg( int_vec& iv, hy_network_message* nm )
{
	for( uint i = 0; i < iv.size(); i++ )
	{
		nm->set_player_id( iv[i] );
		nm->send();
	}
	return true;
}

uint64 get_cur_system_second()
{
	boost::posix_time::ptime time_t_epoch(boost::gregorian::date(1970,1,1)); 
	boost::posix_time::ptime curTime(boost::posix_time::second_clock::local_time());
	boost::posix_time::time_duration diff = curTime - time_t_epoch;
	return (uint64)diff.total_seconds();
}

/*
bool hy_common_func::read_json( const char* js_name, Json::Value& js_value )
{
	return true;
}
*/